package org.duiduo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.duiduo.api.request.RoleRequest;
import org.duiduo.api.response.RespBean;
import org.duiduo.pojo.Role;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author liangze
 */
public interface IRoleService extends IService<Role> {

    /**
     * 根据用户名获取角色
     *
     * @param username
     * @return
     */
    Role getRoleByUsername(String username);

    /**
     * 添加角色信息
     *
     * @param request
     * @return
     */
    RespBean addRole(RoleRequest request);

    /**
     * 登录之后返回token
     *
     * @param username
     * @param password
     * @param request
     * @return
     */
    RespBean login(String username, String password, HttpServletRequest request);
}
